@use "sass:map";
@use "sass:color";

#fr-heading {
  margin-bottom: 0;
  font-size: 3rem;
  text-align: center;
  user-select: none;
}

#fr-subheading {
  margin-top: 0;
  font-size: 2rem;
  text-align: center;
  color: color.adjust($asphalt, $lightness: 20%);
  user-select: none;
}

.fresh-releases-pill-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;

  @media screen and (max-width: map.get($grid-breakpoints, "lg")) {
    justify-content: center;
  }
}

.fresh-releases-row {
  gap: 0.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.releases-page {
  // FILTERS
  .filters-main {
    top: 1rem;
    position: sticky;
    padding: 1rem 0;

    #filters-container {
      display: flex;
      flex-direction: column;

      #release-filters {
        display: flex;
        flex-direction: column;
        user-select: none;

        #title-container {
          display: flex;
          height: 2rem;
          margin-top: 2rem;
          align-items: center;

          #type-title {
            flex-grow: 1;
            text-transform: uppercase;
            font-size: large;
            font-weight: bold;
          }

          #clearall-btn-inactive {
            display: none;
            flex-grow: 2;
          }

          #clearall-btn-active {
            font-size: 2.5rem;
            flex-grow: 2;
            &:hover {
              font-weight: bold;
              color: $orange;
            }
          }
        }

        #filters-list {
          display: flex;
          flex-direction: column;
          text-transform: lowercase;

          input[type="checkbox"] {
            display: none;
          }

          .type-name-inactive {
            margin-top: 0.5rem;
            padding: 0.25rem 1rem;
            font-weight: normal;
            cursor: pointer;
            color: $asphalt;
            &:hover {
              font-weight: bold;
              color: $blue;
            }
          }

          .type-name-active {
            margin-top: 0.5rem;
            padding: 0.25rem 1rem;
            font-weight: bold;
            cursor: pointer;
            background-color: $orange;
            color: $white;
            border-radius: 4px;
          }
        }
      }
    }
  }

  // Mobile responsive filters
  @media (max-width: map.get($grid-breakpoints, "lg")) {
    .filters-main {
      display: block;
      padding: 1rem;
      font-size: small;
      position: sticky;
      top: 0;
      z-index: 50;
      background-color: $white;

      #filters-container {
        display: block;

        #coverart-checkbox {
          text-align: center;
        }

        #release-filters {
          display: block;

          &:before {
            content: "";
            height: 100%;
            width: 3rem;
            background: linear-gradient(
              90deg,
              rgba(255, 255, 255, 1) 50%,
              rgba(255, 255, 255, 0) 100%
            );
            position: absolute;
            top: 0;
            left: 0;
            z-index: 1;
          }

          &:after {
            content: "";
            height: 100%;
            width: 3rem;
            background: linear-gradient(
              -90deg,
              rgba(255, 255, 255, 1) 50%,
              rgba(255, 255, 255, 0) 100%
            );
            position: absolute;
            top: 0;
            right: 0;
            z-index: 1;
          }

          #title-container {
            display: none;

            #type-title {
              display: none;
            }

            #clearall-btn-inactive {
              display: none;
            }

            #clearall-btn-active {
              display: none;
            }
          }

          #filters-list {
            display: block;
            font-size: small;
            width: 100%;
            overflow-x: auto;
            overflow-y: hidden;
            white-space: nowrap;

            .type-name-inactive {
              margin: 0.5rem 0.25rem;
            }

            .type-name-active {
              margin: 0.5rem 0.25rem;
            }
          }
        }
      }
    }
  }

  // CARDS
  #release-card-grids {
    display: flex;
    justify-content: center;
    flex-direction: column;
  }
}

.release-cards-grid {
  display: grid;
  justify-items: center;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(190px, max-content));
}

// TIMELINE
.releases-timeline {
  flex: 0 0;
  display: flex;
  justify-content: center;
  top: 4rem;
  position: sticky;
  padding: 4rem 1rem;
  // width: 100%;
  // height: 100%;
  max-height: calc(100vh - 8em);

  @media (max-width: map.get($grid-breakpoints, "lg")) {
    height: unset;
    width: 100%;
    position: fixed;
    bottom: 0;
    top: calc(100vh - 100px);
    padding: 1rem 2rem 4rem;
    z-index: 50;
    background-color: $white;
    padding-right: 120px; // sidebar button on the right
  }
}

.release-card-grid-title {
  padding: 0.3em 0;
  position: sticky;
  top: 0;
  z-index: 90;
  background: $white;
  display: flex;
  align-items: center;
  text-align: center;
  font-size: x-large;
  font-weight: 500;
}

.release-card-grid-title::before,
.release-card-grid-title::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid $hr-border-color;
}

.release-card-grid-title:not(:empty)::before {
  margin-right: 2em;
}

.release-card-grid-title:not(:empty)::after {
  margin-left: 2em;
}

.spinner-container {
  margin: 12% 0 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.no-release {
  text-align: center;
  margin-left: auto;
  margin-right: auto;

  img {
    width: 350px;
    height: 350px;
  }
}

#sidebar-fresh-release {
  background: $blue;
  color: $white;
  padding-top: 20px;

  p:first-of-type {
    font-size: 25px;
    font-weight: 900;
  }

  p {
    margin-bottom: 5px;
  }
}

.releases-page-container {
  display: flex;
  gap: 1.5em;
  @media screen and (min-width: map.get($grid-breakpoints, "lg")) {
    // make the sidebar flush with the right-hand side on larger sizes
    margin-right: -15px !important;
  }
  .releases-page {
    flex: 1;
  }
  .sidebar-fresh-releases {
    max-height: 85vh;

    @media screen and (max-width: map.get($grid-breakpoints, "lg")) {
      max-height: calc(100vh - $brainzplayer-height);
    }
  }
}
